home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
PaneListBox.h
< prev
next >
Wrap
Text File
|
1997-08-07
|
2KB
|
92 lines
/*
* File: PaneListBox.h
* Function: A pane containing a list of all the Raven panes.
* Written by: Jesse Jones
*
* Copyright ゥ 1996 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <-> 8/10/96 JDJ created
*/
#pragma once
#include <ZDragSource.h>
#include <ZListBox.h>
// ========================================================================================
// struct SPaneEntry
// ========================================================================================
struct SPaneEntry {
string name;
TPane* pane;
SPaneEntry(const string& str = "") {name = str; pane = nil;}
bool operator==(const SPaneEntry& rhs) const {return name == rhs.name;}
bool operator!=(const SPaneEntry& rhs) const {return name != rhs.name;}
bool operator<(const SPaneEntry& rhs) const {return name < rhs.name;}
};
__MSL_FIX_ITERATORS__(const SPaneEntry);
// ========================================================================================
// class CPaneListBox
// ========================================================================================
class CPaneListBox : public TListBox<SPaneEntry>, public MDragSource {
typedef TListBox<SPaneEntry> Inherited;
//-----------------------------------
// Initialization/Destruction
//
public:
virtual ~CPaneListBox();
CPaneListBox(TView* superView);
//-----------------------------------
// TListBox API
//
protected:
virtual void Invariant() const;
virtual void OnReanimated();
virtual bool OnMouseDown(const TMouseEvent& event);
virtual void OnDrawCell(TCanvas& canvas, const TRect& cellBounds, const SPaneEntry& entry, bool isSelected);
//-----------------------------------
// MDragSource API
//
protected:
virtual void OnAddDragData(TDragSession& session, const TMouseEvent& event);
//-----------------------------------
// MCommander API
//
public:
virtual bool WantsTarget() const;
//-----------------------------------
// TReanimator Support
//
public:
static MReanimatable* Create(MReanimatable* parent);
//-----------------------------------
// Member data
//
protected:
TTextTrait mTextTraits;
};